package com.xzy.sms.web.system.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 权限用户组关联表(因为建表的时候已经是pub_开头了,如果修改为perm_开头还需要修改表的数据，所有这里暂时不做调整)
 * 
 * @author macong
 * @since 1.0
 * @version 2014-4-1 macong
 */
@Entity
@Table(name = "pub_perm_usergroup")
public class PermUsergroup {
    
    /** 主键id */
    @Id
    @GeneratedValue(generator = "UIDGenerator")
    @GenericGenerator(name = "UIDGenerator", strategy = "com.xzyframework.persistence.UIDGenerator")
    @Column(length = 40)
    protected String id;
    
    /** 权限串 */
    private String permStr;
    
    /** 用户组id 这里似乎不需要懒加载,还需要研究 */
    @ManyToOne()
    @JoinColumn(name = "usergroupId")
    private Usergroup usergroup;
    
    /**
     * 构造函数
     */
    public PermUsergroup() {
    }
    
    /**
     * 构造函数
     * 
     * @param permStr permStr
     * @param usergroup usergroup
     */
    public PermUsergroup(String permStr, Usergroup usergroup) {
        this.permStr = permStr;
        this.usergroup = usergroup;
    }
    
    /**
     * @return id
     */
    public String getId() {
        return id;
    }
    
    /**
     * @param id 要设置的 id
     */
    public void setId(String id) {
        this.id = id;
    }
    
    /**
     * @return permStr
     */
    public String getPermStr() {
        return permStr;
    }
    
    /**
     * @param permStr 要设置的 permStr
     */
    public void setPermStr(String permStr) {
        this.permStr = permStr;
    }
    
    /**
     * @return usergroup
     */
    public Usergroup getUsergroup() {
        return usergroup;
    }
    
    /**
     * @param usergroup 要设置的 usergroup
     */
    public void setUsergroup(Usergroup usergroup) {
        this.usergroup = usergroup;
    }
    
}
